package com.dotnet.modules.compact.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dotnet.modules.compact.entity.Compact;
import com.dotnet.modules.compact.entity.CompactPageVo;
import com.dotnet.modules.compact.mapper.CompactMapper;
import com.page.Pagination;
@Service
public class CompactServiceImpl implements CompactService {

	@Autowired
	private CompactMapper compactMapper;
	@Override
	public Compact queryOne(Compact record) {
		// TODO Auto-generated method stub
		return compactMapper.selectOne(record);
	}

	@Override
	public List<Compact> queryAll(Compact record) {
		// TODO Auto-generated method stub
		return compactMapper.select(record);
	}

	@Override
	public int queryCount(Compact record) {
		// TODO Auto-generated method stub
		return compactMapper.selectCount(record);
	}

	@Override
	public Compact queryByPrimaryKey(Object key) {
		// TODO Auto-generated method stub
		return compactMapper.selectByPrimaryKey(key);
	}

	@Override
	public int add(Compact record) {
		// TODO Auto-generated method stub
		return compactMapper.insert(record);
	}

	@Override
	public int addSelective(Compact record) {
		// TODO Auto-generated method stub
		return compactMapper.insertSelective(record);
	}

	@Override
	public int delete(Compact record) {
		// TODO Auto-generated method stub
		return compactMapper.delete(record);
	}

	@Override
	public int deleteByPrimaryKey(Object key) {
		// TODO Auto-generated method stub
		return compactMapper.deleteByPrimaryKey(key);
	}

	@Override
	public int updateByPrimaryKey(Compact record) {
		// TODO Auto-generated method stub
		return compactMapper.updateByPrimaryKey(record);
	}

	@Override
	public int updateByPrimaryKeySelective(Compact record) {
		// TODO Auto-generated method stub
		return compactMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int queryCountByExample(Compact example) {
		// TODO Auto-generated method stub
		return compactMapper.selectCountByExample(example);
	}

	@Override
	public List<Compact> queryByExample(Compact example) {
		// TODO Auto-generated method stub
		return compactMapper.selectByExample(example);
	}

	@Override
	public Pagination pagelist(CompactPageVo compact) {
		// TODO Auto-generated method stub
		Pagination pagination =new Pagination(compact.getPageNo(),compact.getPageSize(),pagecount(compact));
		pagination.setList(compactMapper.pagelist(compact));
		return pagination;
	}

	@Override
	public int pagecount(CompactPageVo compact) {
		// TODO Auto-generated method stub
		return compactMapper.pagecount(compact);
	}

}
